<?php
/**
 * NBaseController : N, means no-need-login
 * 无需登录即可访问的接口,比如登录/注册/密码申诉等
 *
 * Created by PhpStorm.
 * User: silov
 * Date: 16/1/5
 * Time: 10:11
 */
namespace Common\Controller;

use Think\Controller;

class NBaseController extends Controller
{
    /**
     * @var HTTP参数集合体
     */
    public $params;
    protected function _checkSign()
    {
        return true;//开发测试期间不约束sign

        $sign = $this->params['sign'];
        unset($this->params['sign']);

        ksort($this->params);
        $rightSign = md5( http_build_query($this->params) . md5("PaRaMsKeY!@#$&^%") );

        if ($sign !== $rightSign) {
            $this->ajaxReturn(['status'=>10001, 'msg'=>'sign签名验证失败']);
        }
    }
}